<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CMD模块加载器</title>
</head>
<body>
<script src="../js/pig.js"></script>
<script>
    pig.config({
        paths: {
			'user': './js/user.js',
            'book': './js/book.js',
            style: 'css!css/style'
		},
		/**
		 * 模块依赖
		*/
		shim : {
			'user' : {
				'deps' : ['book','style']
			}
		}
    })
    pig.request(['./js/user.js'], function (u, require) {
        var angular = require('../../../../../vendor/angular/1.3.2/angular.js')
        var user = require('./js/user.js')
        var dog = require('./js/dog.js')
        var book = require('./js/book.js')

        console.log('********************')

        console.log('user：' + user.getName())
	    console.log('dog：' + dog.getName())
        console.log('book：' + book.getName())
        console.log(angular)

        pig.request(['./js/dog.js'], function (require) {
            console.log(99999)
        })

        require.request(function () {
            console.log('require.request')
        })

    }).then(function (u, require) {
        var fish = require('./js/fish')
        console.log('fish' + fish.getName())
    }).then(function (user, require) {
        console.log(88889)
        console.log('user：' + user.getName())
    })
</script>
</body>
</html>